home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / GMS / Source / Asm / Chunky / ChunkyPicture.s < prev    next >
Encoding:
Text File  |  1997-05-10  |  2.0 KB  |  94 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;Chunky Screen
  3. ;-------------
  4. ;This demo loads in a picture in chunky format and then calls RefreshScreen()
  5. ;to do the C2P conversion.
  6.  
  7.     INCDIR    "INCLUDES:"
  8.     INCLUDE    "games/games_lib.i"
  9.     INCLUDE    "games/games.i"
  10.  
  11. CALL    MACRO
  12.     jsr    _LVO\1(a6)
  13.     ENDM
  14.  
  15.     SECTION    "ChunkyScreen",CODE
  16.  
  17. ;===========================================================================;
  18. ;                             INITIALISE DEMO
  19. ;===========================================================================;
  20.  
  21.     STARTGMS
  22.  
  23. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  24.     move.l    GMSBase(pc),a6
  25.     lea    ScreenTags(pc),a0
  26.     CALL    AddScreen
  27.     tst.l    d0
  28.     beq.s    .Error_Screen
  29.  
  30.     move.l    Screen(pc),a0
  31.     lea    PictureTags(pc),a1
  32.     move.l    GS_MemPtr1(a0),PicData
  33.     CALL    LoadPic
  34.     tst.l    d0
  35.     beq.s    .Error_Picture
  36.  
  37.     move.l    Picture(pc),a1
  38.     move.l    PIC_Palette(a1),GS_Palette(a0)
  39.     CALL    UpdatePalette
  40.  
  41.     CALL    ShowScreen
  42.  
  43.     bsr.s    Main
  44.  
  45. .ReturnToDOS
  46.     move.l    GMSBase(pc),a6
  47.     move.l    Picture(pc),a1
  48.     CALL    FreePic
  49. .Error_Picture
  50.     move.l    Screen(pc),a0
  51.     CALL    DeleteScreen
  52. .Error_Screen
  53.     MOVEM.L    (SP)+,A0-A6/D1-D7
  54.     moveq    #ERR_OK,d0
  55.     rts
  56.  
  57. ;===========================================================================;
  58. ;                                MAIN LOOP
  59. ;===========================================================================;
  60.  
  61. Main:    move.l    GMSBase(pc),a6
  62.     move.l    Screen(pc),a0
  63.     CALL    RefreshScreen
  64.     CALL    WaitLMB
  65.     rts
  66.  
  67. ;===========================================================================;
  68. ;                                  DATA
  69. ;===========================================================================;
  70.  
  71. ScreenTags:
  72.     dc.l    TAGS_GAMESCREEN
  73. Screen:    dc.l    0
  74.     dc.l    GSA_ScrWidth,320
  75.     dc.l    GSA_ScrHeight,256
  76.     dc.l    GSA_ScrType,CHUNKY8
  77.     dc.l    TAGEND
  78.  
  79. PictureTags:
  80.     dc.l    TAGS_PICTURE
  81. Picture    dc.l    0
  82.     dc.l    PCA_Data
  83. PicData    dc.l    0
  84.     dc.l    PCA_Width,320
  85.     dc.l    PCA_Height,256
  86.     dc.l    PCA_ScrType,CHUNKY8
  87.     dc.l    PCA_Options,GETPALETTE
  88.     dc.l    PCA_File,.file
  89.     dc.l    TAGEND
  90.  
  91. .file    dc.b    "GMS:demos/data/PIC.Green",0
  92.     even
  93.  
  94.